import request from '@/utils/request'

// 获取课程列表
export function getCourseList(params) {
  return request({
    url: '/api/course/list/page',
    method: 'get',
    params
  })
}

// 获取课程详情
export function getCourseById(id) {
  return request({
    url: '/api/course/get',
    method: 'get',
    params: { id }
  })
}

// 添加课程
export function addCourse(data) {
  return request({
    url: '/api/course/enroll',
    method: 'post',
    data
  })
}

// 收藏课程
export function favoriteCourse(data) {
  return request({
    url: '/api/course/favorite',
    method: 'post',
    data
  })
} 